import leftNavConfig from './../layout/leftNav.config';
export const getNamesByPath = (path)=>{
    let arr = [];
    leftNavConfig.leftMenu.forEach((item)=>{
        if(item.path == path){
            arr.push({
                title:item.title
            });
            return;
        }else if(!!item.children && item.children.length > 0){
            let parentNode = item;
            let cArr = item.children;
            cArr.forEach((citem)=>{
                if(citem.path == path){
                    arr.push({
                        title:parentNode.title
                    });
                    arr.push({
                        title:citem.title
                    });
                    return;
                }
            });
            if(arr.length > 1) return;
        };
    });
    return arr;
};

